Skip to content

[5.x] Fix structure not being saved to collection#13479

Merged
jasonvarga merged 2 commits into5.xfrom
fix-collection-structure-not-getting-saved
Jan 8, 2026
Merged

[5.x] Fix structure not being saved to collection#13479
jasonvarga merged 2 commits into5.xfrom
fix-collection-structure-not-getting-saved

Conversation

@jasonvarga
Copy link
Copy Markdown
Member

@jasonvarga jasonvarga commented Jan 8, 2026

Fixes #13014

The issue is that when Collection::handleExists() on the line above gets called, it pulls the collections from the cache, which gets the dirty state attributes, which includes getting the structure, which blinks it. The one in the cache doesn't have a structure, so null gets stored in blink.

Then, when the actual collection is saved in a moment, checks the blink for the structure, needs the null that was put there, and writes nothing.

This started happening since #11150 because now that the Collection class uses the HasDirtyState trait, these kick in:

if (method_exists($item, 'syncOriginal')) {
$item->syncOriginal();
}

I don't love this fix but it'll do for now until there's more time for something better.

@jasonvarga jasonvarga merged commit 018ca64 into 5.x Jan 8, 2026
28 checks passed
@jasonvarga jasonvarga deleted the fix-collection-structure-not-getting-saved branch January 8, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Orderable property won't save in collection

1 participant